
// <copyright file="MetadataManager.cs" company="Subhadra Software Solutions">
//   
// </copyright>
// <summary>
//   The metadata manager.
// </summary>

namespace SubhadraSolutions.Sharp.Utils.Data.Dynamic
{
    using System;

    /// <summary>
    /// The metadata manager.
    /// </summary>
    public static class MetadataManager
    {
        #region Constructors and Finalizers

        /// <summary>
        /// Initializes static members of the <see cref="MetadataManager"/> class.
        /// </summary>
        static MetadataManager()
        {
            MetadataProvider = new AttributeBasedMetadataProvider();
        }

        #endregion Constructors and Finalizers

        #region Public Properties

        /// <summary>
        /// Gets or sets the metadata provider.
        /// </summary>
        /// <value>
        /// The metadata provider.
        /// </value>
        public static IMetadataProvider MetadataProvider { get; set; }

        #endregion Public Properties

        #region Public Methods and Operators

        /// <summary>
        /// The get meta data.
        /// </summary>
        /// <param name="entityType">
        /// The entity type.
        /// </param>
        /// <returns>
        /// The <see cref="IDbTableMetadata"/>.
        /// </returns>
        public static IDbTableMetadata GetMetaData(Type entityType)
        {
            return MetadataProvider.GetMetaData(entityType);
        }

        #endregion Public Methods and Operators
    }
}